/**
 * Say Hello to Go language.
 */

package main

import (
	"fmt"
)

func main() {
	const WIDTH int = 10
	const HEIGHT int = 12

	var Area int
	Area = WIDTH * HEIGHT

	fmt.Println("hello go!")
	fmt.Println("Area is:", Area)

	fmt.Println("A:", A, "B:", B, "C:", C)
	fmt.Println("A:", A, "B:", B, "C:", C)
	comment()
	iotaTest()
	ptrTest()
}

const(
	A = iota
	B
	C
)

const(
	i = 1 << iota
	j = 3 << iota
	k
	l
)

func iotaTest(){
	fmt.Println("i:", i, "j:", j, "k", k, "l", l)
}

func ptrTest(){
	s := 400
	var ptr *int
	ptr = &s
	ptr1 := &s

	fmt.Println("Ptr:", ptr, "Ptr1:", ptr1)
	fmt.Println("*Ptr:", *ptr, "*Ptr1:", *ptr1)
}
//var b bool = false;
//var x int = 1;
//var y float32 = 1.0123;
//var s string = "hello";
//var p types.Pointer = "prototypes";
//var b types.Array = "";
//var f types.Slice = "";
//var i interface{} = "";
//var m types.Map = "";
//var c types.Chan = "";
func comment() {
	var a int = 10;
	var b = 11;
	c := 10;

	if ( a == b && b == c ) {
		fmt.Print("vaule is :", a);
	} else {
		fmt.Println("a != b && b != c");
		fmt.Println("a :", a, "b :", b, "c :", c);
	}

	var (
		x float32
		y float32
	)

	x = 101.000000;
	y = 100.0000;

	if (x - y == 1) {
		fmt.Println("x == y");
	}else {
		fmt.Println("x:", x, "y:", y);
	}

	// 效率最高，优先使用的初始化变量的方式，仅在函数内使用
	m := false;
	n := true;

	fmt.Println("m:", m, "n:", n);

	m, n = n, m;
	fmt.Println("m:", m, "n:", n);
}


